<template>
  <div class="app-container">
    <!-- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="生产/委外订单号" prop="orderNum">
        <el-input
          v-model="queryParams.orderNum"
          placeholder="请输入生产/委外订单号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="订单行号" prop="lineorderCode">
        <el-input
          v-model="queryParams.lineorderCode"
          placeholder="请输入订单行号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="产品id" prop="prodId">
        <el-input
          v-model="queryParams.prodId"
          placeholder="请输入产品id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="产品代码" prop="prodCode">
        <el-input
          v-model="queryParams.prodCode"
          placeholder="请输入产品代码"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="产品名称" prop="prodName">
        <el-input
          v-model="queryParams.prodName"
          placeholder="请输入产品名称"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="产品规格型号" prop="prodModel">
        <el-input
          v-model="queryParams.prodModel"
          placeholder="请输入产品规格型号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="产品辅助属性" prop="prodProperties">
        <el-input
          v-model="queryParams.prodProperties"
          placeholder="请输入产品辅助属性"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="生产单位" prop="prodUnit">
        <el-input
          v-model="queryParams.prodUnit"
          placeholder="请输入生产单位"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="生产数量" prop="prodNum">
        <el-input
          v-model="queryParams.prodNum"
          placeholder="请输入生产数量"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="生产投料单号" prop="feedingNum">
        <el-input
          v-model="queryParams.feedingNum"
          placeholder="请输入生产投料单号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="变更标志" prop="changeSign">
        <el-input
          v-model="queryParams.changeSign"
          placeholder="请输入变更标志"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="物料id" prop="goodsId">
        <el-input
          v-model="queryParams.goodsId"
          placeholder="请输入物料id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="物料代码" prop="goodsCode">
        <el-input
          v-model="queryParams.goodsCode"
          placeholder="请输入物料代码"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="物料名称" prop="goodsName">
        <el-input
          v-model="queryParams.goodsName"
          placeholder="请输入物料名称"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="客户bom编号" prop="customerBomNum">
        <el-input
          v-model="queryParams.customerBomNum"
          placeholder="请输入客户bom编号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="计划模式" prop="planPattern">
        <el-input
          v-model="queryParams.planPattern"
          placeholder="请输入计划模式"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="计划跟踪号" prop="planTrackingNum">
        <el-input
          v-model="queryParams.planTrackingNum"
          placeholder="请输入计划跟踪号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="规格型号" prop="goodsModel">
        <el-input
          v-model="queryParams.goodsModel"
          placeholder="请输入规格型号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="物料辅助属性" prop="goodsProperties">
        <el-input
          v-model="queryParams.goodsProperties"
          placeholder="请输入物料辅助属性"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="子项类型" prop="subitemType">
        <el-select v-model="queryParams.subitemType" placeholder="请选择子项类型" clearable size="small">
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="单位用量" prop="unitConsumption">
        <el-input
          v-model="queryParams.unitConsumption"
          placeholder="请输入单位用量"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="单位" prop="goodsUnit">
        <el-input
          v-model="queryParams.goodsUnit"
          placeholder="请输入单位"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="标准用量" prop="standardDosage">
        <el-input
          v-model="queryParams.standardDosage"
          placeholder="请输入标准用量"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="损耗率" prop="lossRate">
        <el-input
          v-model="queryParams.lossRate"
          placeholder="请输入损耗率"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="损耗数量" prop="lossNum">
        <el-input
          v-model="queryParams.lossNum"
          placeholder="请输入损耗数量"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="应发数量" prop="issuedNum">
        <el-input
          v-model="queryParams.issuedNum"
          placeholder="请输入应发数量"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="计划投料数量" prop="planIssueNum">
        <el-input
          v-model="queryParams.planIssueNum"
          placeholder="请输入计划投料数量"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="计划发料日期" prop="planIssueTime">
        <el-date-picker clearable size="small" style="width: 200px"
          v-model="queryParams.planIssueTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="选择计划发料日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="仓库" prop="warehouse">
        <el-input
          v-model="queryParams.warehouse"
          placeholder="请输入仓库"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="仓位" prop="position">
        <el-input
          v-model="queryParams.position"
          placeholder="请输入仓位"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="批号" prop="batchNum">
        <el-input
          v-model="queryParams.batchNum"
          placeholder="请输入批号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="倒冲" prop="backflush">
        <el-input
          v-model="queryParams.backflush"
          placeholder="请输入倒冲"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="工序号" prop="processNum">
        <el-input
          v-model="queryParams.processNum"
          placeholder="请输入工序号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="工序" prop="workingProcess">
        <el-input
          v-model="queryParams.workingProcess"
          placeholder="请输入工序"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="工位" prop="station">
        <el-input
          v-model="queryParams.station"
          placeholder="请输入工位"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="关键件" prop="keyParts">
        <el-input
          v-model="queryParams.keyParts"
          placeholder="请输入关键件"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="使用状态" prop="usageStatus">
        <el-select v-model="queryParams.usageStatus" placeholder="请选择使用状态" clearable size="small">
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="报废数量" prop="scrapNum">
        <el-input
          v-model="queryParams.scrapNum"
          placeholder="请输入报废数量"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="锁库标志" prop="lockSign">
        <el-input
          v-model="queryParams.lockSign"
          placeholder="请输入锁库标志"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="补料数量" prop="replenishmentNum">
        <el-input
          v-model="queryParams.replenishmentNum"
          placeholder="请输入补料数量"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="变更人" prop="alterer">
        <el-input
          v-model="queryParams.alterer"
          placeholder="请输入变更人"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="变更时间" prop="alterTime">
        <el-date-picker clearable size="small" style="width: 200px"
          v-model="queryParams.alterTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="选择变更时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="存在替代关系" prop="substitutionRelationship">
        <el-input
          v-model="queryParams.substitutionRelationship"
          placeholder="请输入存在替代关系"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="位置号" prop="locationNum">
        <el-input
          v-model="queryParams.locationNum"
          placeholder="请输入位置号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="还料尺寸" prop="returnDimension">
        <el-input
          v-model="queryParams.returnDimension"
          placeholder="请输入还料尺寸"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="单据编号" prop="documentNum">
        <el-input
          v-model="queryParams.documentNum"
          placeholder="请输入单据编号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="制单人" prop="producer">
        <el-input
          v-model="queryParams.producer"
          placeholder="请输入制单人"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="制单时间" prop="prodTime">
        <el-date-picker clearable size="small" style="width: 200px"
          v-model="queryParams.prodTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="选择制单时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="审核人" prop="reviewer">
        <el-input
          v-model="queryParams.reviewer"
          placeholder="请输入审核人"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="审核日期" prop="auditTime">
        <el-date-picker clearable size="small" style="width: 200px"
          v-model="queryParams.auditTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="选择审核日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="审核标志" prop="auditMark">
        <el-input
          v-model="queryParams.auditMark"
          placeholder="请输入审核标志"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form> -->

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['prodplan:feeding_examine:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['prodplan:feeding_examine:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['prodplan:feeding_examine:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['prodplan:feeding_examine:export']"
        >导出</el-button>
      </el-col>
	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="feeding_examineList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="审核标志" align="center" prop="feedingsId" />
      <el-table-column label="生产/委外订单号" align="center" prop="orderNum" />
      <el-table-column label="订单行号" align="center" prop="lineorderCode" />
      <el-table-column label="产品id" align="center" prop="prodId" />
      <el-table-column label="产品代码" align="center" prop="prodCode" />
      <el-table-column label="产品名称" align="center" prop="prodName" />
      <el-table-column label="产品规格型号" align="center" prop="prodModel" />
      <el-table-column label="产品辅助属性" align="center" prop="prodProperties" />
      <el-table-column label="生产单位" align="center" prop="prodUnit" />
      <el-table-column label="生产数量" align="center" prop="prodNum" />
      <el-table-column label="生产投料单号" align="center" prop="feedingNum" />
      <el-table-column label="变更标志" align="center" prop="changeSign" />
      <el-table-column label="变更原因" align="center" prop="changeReason" />
      <el-table-column label="物料id" align="center" prop="goodsId" />
      <el-table-column label="物料代码" align="center" prop="goodsCode" />
      <el-table-column label="物料名称" align="center" prop="goodsName" />
      <el-table-column label="客户bom编号" align="center" prop="customerBomNum" />
      <el-table-column label="计划模式" align="center" prop="planPattern" />
      <el-table-column label="计划跟踪号" align="center" prop="planTrackingNum" />
      <el-table-column label="规格型号" align="center" prop="goodsModel" />
      <el-table-column label="物料辅助属性" align="center" prop="goodsProperties" />
      <el-table-column label="子项类型" align="center" prop="subitemType" />
      <el-table-column label="单位用量" align="center" prop="unitConsumption" />
      <el-table-column label="单位" align="center" prop="goodsUnit" />
      <el-table-column label="标准用量" align="center" prop="standardDosage" />
      <el-table-column label="损耗率" align="center" prop="lossRate" />
      <el-table-column label="损耗数量" align="center" prop="lossNum" />
      <el-table-column label="应发数量" align="center" prop="issuedNum" />
      <el-table-column label="计划投料数量" align="center" prop="planIssueNum" />
      <el-table-column label="计划发料日期" align="center" prop="planIssueTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.planIssueTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="仓库" align="center" prop="warehouse" />
      <el-table-column label="仓位" align="center" prop="position" />
      <el-table-column label="批号" align="center" prop="batchNum" />
      <el-table-column label="倒冲" align="center" prop="backflush" />
      <el-table-column label="工序号" align="center" prop="processNum" />
      <el-table-column label="工序" align="center" prop="workingProcess" />
      <el-table-column label="工位" align="center" prop="station" />
      <el-table-column label="关键件" align="center" prop="keyParts" />
      <el-table-column label="使用状态" align="center" prop="usageStatus" />
      <el-table-column label="报废数量" align="center" prop="scrapNum" />
      <el-table-column label="锁库标志" align="center" prop="lockSign" />
      <el-table-column label="补料数量" align="center" prop="replenishmentNum" />
      <el-table-column label="变更人" align="center" prop="alterer" />
      <el-table-column label="变更时间" align="center" prop="alterTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.alterTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="备注" align="center" prop="remarks" />
      <el-table-column label="存在替代关系" align="center" prop="substitutionRelationship" />
      <el-table-column label="位置号" align="center" prop="locationNum" />
      <el-table-column label="还料尺寸" align="center" prop="returnDimension" />
      <el-table-column label="单据编号" align="center" prop="documentNum" />
      <el-table-column label="制单人" align="center" prop="producer" />
      <el-table-column label="制单时间" align="center" prop="prodTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.prodTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="审核人" align="center" prop="reviewer" />
      <el-table-column label="审核日期" align="center" prop="auditTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.auditTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="审核标志" align="center" prop="auditMark" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['prodplan:feeding_examine:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['prodplan:feeding_examine:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改投料审核对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="生产/委外订单号" prop="orderNum">
          <el-input v-model="form.orderNum" placeholder="请输入生产/委外订单号" />
        </el-form-item>
        <el-form-item label="订单行号" prop="lineorderCode">
          <el-input v-model="form.lineorderCode" placeholder="请输入订单行号" />
        </el-form-item>
        <el-form-item label="产品id" prop="prodId">
          <el-input v-model="form.prodId" placeholder="请输入产品id" />
        </el-form-item>
        <el-form-item label="产品代码" prop="prodCode">
          <el-input v-model="form.prodCode" placeholder="请输入产品代码" />
        </el-form-item>
        <el-form-item label="产品名称" prop="prodName">
          <el-input v-model="form.prodName" placeholder="请输入产品名称" />
        </el-form-item>
        <el-form-item label="产品规格型号" prop="prodModel">
          <el-input v-model="form.prodModel" placeholder="请输入产品规格型号" />
        </el-form-item>
        <el-form-item label="产品辅助属性" prop="prodProperties">
          <el-input v-model="form.prodProperties" placeholder="请输入产品辅助属性" />
        </el-form-item>
        <el-form-item label="生产单位" prop="prodUnit">
          <el-input v-model="form.prodUnit" placeholder="请输入生产单位" />
        </el-form-item>
        <el-form-item label="生产数量" prop="prodNum">
          <el-input v-model="form.prodNum" placeholder="请输入生产数量" />
        </el-form-item>
        <el-form-item label="生产投料单号" prop="feedingNum">
          <el-input v-model="form.feedingNum" placeholder="请输入生产投料单号" />
        </el-form-item>
        <el-form-item label="变更标志" prop="changeSign">
          <el-input v-model="form.changeSign" placeholder="请输入变更标志" />
        </el-form-item>
        <el-form-item label="变更原因" prop="changeReason">
          <el-input v-model="form.changeReason" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="物料id" prop="goodsId">
          <el-input v-model="form.goodsId" placeholder="请输入物料id" />
        </el-form-item>
        <el-form-item label="物料代码" prop="goodsCode">
          <el-input v-model="form.goodsCode" placeholder="请输入物料代码" />
        </el-form-item>
        <el-form-item label="物料名称" prop="goodsName">
          <el-input v-model="form.goodsName" placeholder="请输入物料名称" />
        </el-form-item>
        <el-form-item label="客户bom编号" prop="customerBomNum">
          <el-input v-model="form.customerBomNum" placeholder="请输入客户bom编号" />
        </el-form-item>
        <el-form-item label="计划模式" prop="planPattern">
          <el-input v-model="form.planPattern" placeholder="请输入计划模式" />
        </el-form-item>
        <el-form-item label="计划跟踪号" prop="planTrackingNum">
          <el-input v-model="form.planTrackingNum" placeholder="请输入计划跟踪号" />
        </el-form-item>
        <el-form-item label="规格型号" prop="goodsModel">
          <el-input v-model="form.goodsModel" placeholder="请输入规格型号" />
        </el-form-item>
        <el-form-item label="物料辅助属性" prop="goodsProperties">
          <el-input v-model="form.goodsProperties" placeholder="请输入物料辅助属性" />
        </el-form-item>
        <el-form-item label="子项类型" prop="subitemType">
          <el-select v-model="form.subitemType" placeholder="请选择子项类型">
            <el-option label="请选择字典生成" value="" />
          </el-select>
        </el-form-item>
        <el-form-item label="单位用量" prop="unitConsumption">
          <el-input v-model="form.unitConsumption" placeholder="请输入单位用量" />
        </el-form-item>
        <el-form-item label="单位" prop="goodsUnit">
          <el-input v-model="form.goodsUnit" placeholder="请输入单位" />
        </el-form-item>
        <el-form-item label="标准用量" prop="standardDosage">
          <el-input v-model="form.standardDosage" placeholder="请输入标准用量" />
        </el-form-item>
        <el-form-item label="损耗率" prop="lossRate">
          <el-input v-model="form.lossRate" placeholder="请输入损耗率" />
        </el-form-item>
        <el-form-item label="损耗数量" prop="lossNum">
          <el-input v-model="form.lossNum" placeholder="请输入损耗数量" />
        </el-form-item>
        <el-form-item label="应发数量" prop="issuedNum">
          <el-input v-model="form.issuedNum" placeholder="请输入应发数量" />
        </el-form-item>
        <el-form-item label="计划投料数量" prop="planIssueNum">
          <el-input v-model="form.planIssueNum" placeholder="请输入计划投料数量" />
        </el-form-item>
        <el-form-item label="计划发料日期" prop="planIssueTime">
          <el-date-picker clearable size="small" style="width: 200px"
            v-model="form.planIssueTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择计划发料日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="仓库" prop="warehouse">
          <el-input v-model="form.warehouse" placeholder="请输入仓库" />
        </el-form-item>
        <el-form-item label="仓位" prop="position">
          <el-input v-model="form.position" placeholder="请输入仓位" />
        </el-form-item>
        <el-form-item label="批号" prop="batchNum">
          <el-input v-model="form.batchNum" placeholder="请输入批号" />
        </el-form-item>
        <el-form-item label="倒冲" prop="backflush">
          <el-input v-model="form.backflush" placeholder="请输入倒冲" />
        </el-form-item>
        <el-form-item label="工序号" prop="processNum">
          <el-input v-model="form.processNum" placeholder="请输入工序号" />
        </el-form-item>
        <el-form-item label="工序" prop="workingProcess">
          <el-input v-model="form.workingProcess" placeholder="请输入工序" />
        </el-form-item>
        <el-form-item label="工位" prop="station">
          <el-input v-model="form.station" placeholder="请输入工位" />
        </el-form-item>
        <el-form-item label="关键件" prop="keyParts">
          <el-input v-model="form.keyParts" placeholder="请输入关键件" />
        </el-form-item>
        <el-form-item label="使用状态">
          <el-radio-group v-model="form.usageStatus">
            <el-radio label="1">请选择字典生成</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="报废数量" prop="scrapNum">
          <el-input v-model="form.scrapNum" placeholder="请输入报废数量" />
        </el-form-item>
        <el-form-item label="锁库标志" prop="lockSign">
          <el-input v-model="form.lockSign" placeholder="请输入锁库标志" />
        </el-form-item>
        <el-form-item label="补料数量" prop="replenishmentNum">
          <el-input v-model="form.replenishmentNum" placeholder="请输入补料数量" />
        </el-form-item>
        <el-form-item label="变更人" prop="alterer">
          <el-input v-model="form.alterer" placeholder="请输入变更人" />
        </el-form-item>
        <el-form-item label="变更时间" prop="alterTime">
          <el-date-picker clearable size="small" style="width: 200px"
            v-model="form.alterTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择变更时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="备注" prop="remarks">
          <el-input v-model="form.remarks" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="存在替代关系" prop="substitutionRelationship">
          <el-input v-model="form.substitutionRelationship" placeholder="请输入存在替代关系" />
        </el-form-item>
        <el-form-item label="位置号" prop="locationNum">
          <el-input v-model="form.locationNum" placeholder="请输入位置号" />
        </el-form-item>
        <el-form-item label="还料尺寸" prop="returnDimension">
          <el-input v-model="form.returnDimension" placeholder="请输入还料尺寸" />
        </el-form-item>
        <el-form-item label="单据编号" prop="documentNum">
          <el-input v-model="form.documentNum" placeholder="请输入单据编号" />
        </el-form-item>
        <el-form-item label="制单人" prop="producer">
          <el-input v-model="form.producer" placeholder="请输入制单人" />
        </el-form-item>
        <el-form-item label="制单时间" prop="prodTime">
          <el-date-picker clearable size="small" style="width: 200px"
            v-model="form.prodTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择制单时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="审核人" prop="reviewer">
          <el-input v-model="form.reviewer" placeholder="请输入审核人" />
        </el-form-item>
        <el-form-item label="审核日期" prop="auditTime">
          <el-date-picker clearable size="small" style="width: 200px"
            v-model="form.auditTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择审核日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="审核标志" prop="auditMark">
          <el-input v-model="form.auditMark" placeholder="请输入审核标志" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listFeeding_examine, getFeeding_examine, delFeeding_examine, addFeeding_examine, updateFeeding_examine, exportFeeding_examine } from "@/api/prodplan/feeding_examine";

export default {
  name: "Feeding_examine",
  components: {
  },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 投料审核表格数据
      feeding_examineList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        orderNum: undefined,
        lineorderCode: undefined,
        prodId: undefined,
        prodCode: undefined,
        prodName: undefined,
        prodModel: undefined,
        prodProperties: undefined,
        prodUnit: undefined,
        prodNum: undefined,
        feedingNum: undefined,
        changeSign: undefined,
        changeReason: undefined,
        goodsId: undefined,
        goodsCode: undefined,
        goodsName: undefined,
        customerBomNum: undefined,
        planPattern: undefined,
        planTrackingNum: undefined,
        goodsModel: undefined,
        goodsProperties: undefined,
        subitemType: undefined,
        unitConsumption: undefined,
        goodsUnit: undefined,
        standardDosage: undefined,
        lossRate: undefined,
        lossNum: undefined,
        issuedNum: undefined,
        planIssueNum: undefined,
        planIssueTime: undefined,
        warehouse: undefined,
        position: undefined,
        batchNum: undefined,
        backflush: undefined,
        processNum: undefined,
        workingProcess: undefined,
        station: undefined,
        keyParts: undefined,
        usageStatus: undefined,
        scrapNum: undefined,
        lockSign: undefined,
        replenishmentNum: undefined,
        alterer: undefined,
        alterTime: undefined,
        remarks: undefined,
        substitutionRelationship: undefined,
        locationNum: undefined,
        returnDimension: undefined,
        documentNum: undefined,
        producer: undefined,
        prodTime: undefined,
        reviewer: undefined,
        auditTime: undefined,
        auditMark: undefined
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询投料审核列表 */
    getList() {
      this.loading = true;
      listFeeding_examine(this.queryParams).then(response => {
        this.feeding_examineList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        feedingsId: undefined,
        orderNum: undefined,
        lineorderCode: undefined,
        prodId: undefined,
        prodCode: undefined,
        prodName: undefined,
        prodModel: undefined,
        prodProperties: undefined,
        prodUnit: undefined,
        prodNum: undefined,
        feedingNum: undefined,
        changeSign: undefined,
        changeReason: undefined,
        goodsId: undefined,
        goodsCode: undefined,
        goodsName: undefined,
        customerBomNum: undefined,
        planPattern: undefined,
        planTrackingNum: undefined,
        goodsModel: undefined,
        goodsProperties: undefined,
        subitemType: undefined,
        unitConsumption: undefined,
        goodsUnit: undefined,
        standardDosage: undefined,
        lossRate: undefined,
        lossNum: undefined,
        issuedNum: undefined,
        planIssueNum: undefined,
        planIssueTime: undefined,
        warehouse: undefined,
        position: undefined,
        batchNum: undefined,
        backflush: undefined,
        processNum: undefined,
        workingProcess: undefined,
        station: undefined,
        keyParts: undefined,
        usageStatus: 0,
        scrapNum: undefined,
        lockSign: undefined,
        replenishmentNum: undefined,
        alterer: undefined,
        alterTime: undefined,
        remarks: undefined,
        substitutionRelationship: undefined,
        locationNum: undefined,
        returnDimension: undefined,
        documentNum: undefined,
        producer: undefined,
        prodTime: undefined,
        reviewer: undefined,
        auditTime: undefined,
        auditMark: undefined
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.feedingsId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加投料审核";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const feedingsId = row.feedingsId || this.ids
      getFeeding_examine(feedingsId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改投料审核";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.feedingsId != null) {
            updateFeeding_examine(this.form).then(response => {
              this.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addFeeding_examine(this.form).then(response => {
              this.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const feedingsIds = row.feedingsId || this.ids;
      this.$confirm('是否确认删除投料审核编号为"' + feedingsIds + '"的数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return delFeeding_examine(feedingsIds);
        }).then(() => {
          this.getList();
          this.msgSuccess("删除成功");
        })
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$confirm('是否确认导出所有投料审核数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return exportFeeding_examine(queryParams);
        }).then(response => {
          this.download(response.msg);
        })
    }
  }
};
</script>
